<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		
	</head>
	<body>
		<p id ="p1"></p>
		<input type="button" value="停止" onclick="clearTimeout(t)" >
		<input type="button" value="启动" onclick="showTime()"/>
		<script type="text/javascript">
			var t;
			function showTime(){
				var d = new Date();
				document.getElementById("p1").innerText = d.toLocaleString();
				
				t = setTimeout("showTime()",1000);
			}
			
			showTime();
			
		</script>
	</body>
</html>
